<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #template {
        display: none;
      }
    </style>
  </head>
  <body>
    <div id="template">
      <!-- 当成attr 使用 setAttribute设置属性 -->
      <!-- <h1 id="xxx" :name.attr="count">111</h1> -->

      <!-- 使用el.prop='xx'设置属性 -->
      <h1 id="xxx" .prop="count">111</h1>
    </div>
    <div id="app"></div>
    <script src="../../../../packages/vue/dist/vue.global.js"></script>

    <script>
      const { createApp, ref, reactive } = Vue

      const template = document.querySelector('#template')?.innerHTML

      const App = {
        setup() {
          const state = reactive({count: '------'})
          const count = ref('--------')
          const add = (event, arg) => {
            console.log(event, arg)
            count.value++
          }
          return {
            count,
            add,
            state,
            attr: 'name'
          }
        },
        template
      }

      createApp(App).mount('#app')
    </script>
  </body>
</html>
